import javax.sound.midi.*;
/**
 * Created with Intellij IDEA.
 * Description;
 * User:墨琦
 * Data:2023-03-10
 * Time:22:38
 */
public class main1 {
    public static void main(String[] args) {
        main1 mi=new main1();
        if(args.length<2)
        {
            System.out.println("咳咳");
        }
        else {
            int instrument = Integer.parseInt((args[0]));
            int note = Integer.parseInt(args[1]);
            mi.play(instrument, note);
        }

    }
    public void play(int instrument,int note)
    {
        try{
            Sequencer player= MidiSystem.getSequencer();
            player.open();
            Sequence seq=new Sequence(Sequence.PPQ,4);
            Track track= seq.createTrack();

            MidiEvent event=null;

            ShortMessage first=new ShortMessage();
            first.setMessage(192,1,instrument,0);
            MidiEvent noteon =new MidiEvent(first,1);
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }

}

